package com.example.unisys.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.unisys.dao.MenuMapper;
import com.example.unisys.entity.Menu;
import com.example.unisys.entity.RoleMenu;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
public class MenuService extends ServiceImpl<MenuMapper, Menu> {
    public List<Menu> findUserPermissions(String username) {
        return this.baseMapper.findUserPermissions(username);
    }

    public List<RoleMenu> findUserMenus(String username) {
        return this.baseMapper.findUserMenus(username);
    }

}
